﻿using System;
using MailClient;
using MailClient.Data;

namespace MailClient.Commands
{
    /// <summary>
    /// Interface for all commands
    /// </summary>
    interface ICommand: IDisposable
    {
        /// <summary>
        /// Returns a boolean indicating how the command finished
        /// </summary>
        /// <param name="job">The job for which this command is to be run against</param>
        /// <param name="email">Email address of the sender that requested the command</param>
        /// <returns>Returns TRUE if it completes successfully, FALSE otherwise</returns>
        bool Command(Job job);

        /// <summary>
        /// Response message. It will be available if the Command procedure returns TRUE
        /// </summary>
        MailMessage MsgReply { get; }

        /// <summary>
        /// Contains the remainder of the query string without the first command.
        /// Query string should be formatted job, job, person, person Argument
        /// </summary>
        Handlers.designator Designator { get; set; }

        /// <summary>
        /// Procedure for saving data
        /// </summary>
        /// <returns></returns>
        bool CommitData();

    }
}
